﻿
//===============================================================================
//	CFixed1024Info
//	打开任务对话框
//===============================================================================

#include "CFixed1024Info.h"


//-------------------------------------------------------------------------------
CFixed1024Info::CFixed1024Info(uint32_t uid, uint32_t pn)
	: BaseMessage(uid, pn)
{
	_safe_guard_begin;
	_safe_guard_end;
}

//-------------------------------------------------------------------------------
CFixed1024Info::~CFixed1024Info(void)
{

}

//-------------------------------------------------------------------------------
void CFixed1024Info::SetFixed1024Info(PlayerFixedIntegerArray * msState
	, uint32_t startPos, uint32_t endPos)
{
	_safe_guard_begin;

	if (startPos > endPos)
		return;

	if (endPos >= 1024 || 0 > startPos)
		return;

	if (endPos - startPos >= 256)
		return;

	if (endPos - startPos > msState->GetMaxCount())
		return;

	Json::Value _jv;
	_jv.clear();

	for (uint32_t i = startPos; i <= endPos; ++i )
	{
		_jv.append(msState->GetValue(i));
	}

	m_jv["info"] = _jv;
	m_jv["sPos"] = startPos;
	m_jv["ePos"] = endPos;
	m_jv["ret"] = 0;

	_safe_guard_end;
}
